import socket

r = socket.socket()
adress = ("127.0.0.1",7000)
r.connect(adress)

while True:
    i = input("输入：")
    if i == "exit":
        break
    r.send(bytes(i,"utf8")) #传输要用二进制
    data = r.recv(1024)
    print(str(data,"utf8"))
r.close()